/* eslint-disable implicit-arrow-linebreak */
import request from '@/utils/request';

export const getUsersApi = (params) =>
  request.get('/users', {
    params,
  });

export const addUserApi = (data) => request.post('/users', data);

export const fieldValueExistApi = (params) =>
  request.get('/users/exist', {
    params,
  });

export const getUserByIdApi = (id) => request.get(`/users/${id}`);
export const editUserByIdApi = (id, data) => request.put(`/users/${id}`, data);

export const deleteUserByIdApi = (id) => request.delete(`/users/${id}`);

// 获取登陆用户信息
export const getLoginedUserInfoApi = () => request.get('/users/logined');

export const editLoginedUserApi = (data) => request.put('/users/logined', data);
